class register1{
    constructor() {
        this.$('.register-btn').addEventListener('click', this.zhuCe);
       
    }
    zhuCe() {
        // console.log(11);
        let inhpo = document.getElementById("btn").value.trim();
        // console.log(inhpo);
        let reg =/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
        let isValid = reg.test(inhpo);
        console.log(isValid);
        if (isValid==true) {
            location.assign('./index.html')
            
        } else {
            alert("手机号长度不足,在检测一下");
        document.getElementById("btn").value=''
            
        }
        
       
    }



    $(ele) {
        let res = document.querySelectorAll(ele)
        // 如果获取到的是,当个节点的集合,就返回单个节点,如果多个集合就返回多个
        return res.length == 1 ? res[0] : res;
    }

}
new register1();